[Lens] Set better opinionated per chart type default behavior for "include empty rows"#263521
Draft
awahab07 wants to merge 31 commits into
Conversation
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
…witch-off_include-empty-rows_config-option-for-some-charts
Contributor
💔 Build Failed
Failed CI Steps
Test Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #254889
Summary
- Introduce a shared
- Use that port to default date histogram
- Apply the same defaults consistently across Lens editor flows, subtype switches, chart switches, suggestions, suggestions API subtype selection, and embeddable config-builder/API ingress.
BeforeVisualizationDatasourceDefaultsport in@kbn/lens-commonso Lens visualizations can declare datasource-level defaults alongside their dimension groups.includeEmptyRowsoff for new Bar, Heatmap, Pie, Treemap, Metric, Tag cloud, Waffle, and Mosaic charts, while keeping Datatable defaults on and preserving explicit saved/API values.254889-include-empty-rows-before.mov
254889-include-empty-rows-switched-off-after.mov
What changed
@kbn/lens-commonto:includeEmptyRowsdefaults.VisualizationDimensionGroupConfigwithdatasourceDefaultsso visualizations can pass datasource defaults directly to the dimension editor instead of routing them through ad hoc editor props.overwriteExisting: truewhen the user switches to a chart or subtype whose default should take precedence.switchVisualizationType.include_empty_rowsstays omitted at schema/transform boundaries and chart-specific defaults are applied later from visualization context instead of being forced totrue.preferredSeriesTypematches the first series layer subtype, keeping builder output aligned with shared XY default resolution.Behavior
includeEmptyRows.includeEmptyRowsvalue when it is already explicit.include_empty_rowsnow inherit the target chart's default instead of always becomingtrue.How to test
Include empty rowsoffInclude empty rowsonEdgy cases
includeEmptyRowsstate.include_empty_rowsand confirm the resulting Lens state picks up the target chart default rather than forcingtrue.Notes
#256104